package com.hyh.admin.controller.im;


import com.hyh.ad.common.core.domain.AjaxResult;
import com.hyh.ad.common.core.domain.model.SysUser;
import com.hyh.admin.service.ImFollowersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/api/im")
@Api(tags = "IM-用户列表")
public class ImFollowersController {

    @Autowired
    private ImFollowersService contactUserService;

    /*
     * 得到用户列表
     */
    @GetMapping("/user/list")
    @ApiOperation("获取用户列表")
    public AjaxResult getUser() {
        return AjaxResult.success("操作成功",contactUserService.getUserList());
    }

    /*
     * 搜索用户
     */
    @GetMapping("/user/search")
    @ApiOperation("模糊搜索用户")
    public AjaxResult searchUser(@RequestParam("key") String keyword) {
        return AjaxResult.success("操作成功",contactUserService.searchUserByKeyword(keyword));
    }

    /*
     * 多页查询
     */
    @GetMapping("/user/get")
    @ApiOperation("得到用户")
    public AjaxResult searchUserByPage( SysUser sysUser) {
        return AjaxResult.success("操作成功",contactUserService.searchUser(sysUser));
    }
}
